<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>Document</title>
    <link rel="stylesheet" href="../../css/api.css">
	   <link rel="stylesheet" href="../../css/aui_font.css">
	   <link rel="stylesheet" href="../../css/base_icon.css">
	<style>
		body{
			    background-color: #F9FAFE;
		}
		#view{
			
			padding: 20px;
		}
		.top{
			width: 100%;
			display: flex;
			justify-content: space-between;
			color: #FFFEFF;
		}
		.top .name{
			color: #FFFEFF;
			font-weight: bold;
		}
		.top .code{
			color: #FFFEFF;
			font-size: 14px;
		}
		.card{
			background-image: linear-gradient(to right, #A795FB,#9C85FA, #8368F4);
			padding: 20px;
			border-radius: 20px;
			display: flex;
			flex-direction: column;
			align-items: center;
		}
		.count{
			padding: 20px;
			display: flex;
			align-items: flex-end;
		}
		.count .money{
			
			margin-left: 20px;
			color: #FFFEFF;
			font-size: 30px;
			line-height: 30px;
			font-weight: bold;
		}
		.count .bao{
			margin-left: 4px;
			color: #FFFEFF;
			padding: 2px 3px;
			background-color: #9F89F9;
			border-radius: 6px;
		}
		.date{
			color: #CBBCFC;
		}
		.box{
			padding: 10px 0;
		}
		.box .title{
			font-weight: bold;
		}
		.box .list{
			display: flex;
			align-items: center;
			flex-wrap: wrap;
		}
		.box .list .item{
			width: calc(50% - 20px);
			margin-left: 10px;
			margin-right: 10px;
			margin-top: 10px;
			background-color: #FFFFFF;
			display: flex;
			flex-direction: column;
			align-items: center;
			padding: 20px 0;
		}
		.box .list .da{
			padding: 10px;
			font-size: 24px;
			font-weight: bold;
			color: #6749F9;
		}
		.box .list .dt{
			font-size: 14px;
		}
		.box.zhubo .da{
			color: #FF5465;
		}
		
	</style>
</head>

<body>
   <div id="view">
		<div class="card">
			<div class="top">
				<div class="name">{{info.name}}</div>
				<div class="code flex-c" @click="copyText()">{{_i18n('邀请码')}}:{{info.yqm}} <img src="../../image/icon/copy.png" width="16" alt=""></div>
			</div>
			<div class="count">
				<div class="money">{{info.bond_money}}</div>
				<div class="bao">{{_i18n('保证金')}}</div>
			</div>
			<div class="date" v-if="info.expire_time">
				{{_i18n('有效期至')}}: {{info.expire_time}}
			</div>
		</div>
		<div class="box">
			<div class="title">{{_i18n('收入数据')}}</div>
			<div class="list">
				<div class="item">
					<div class="da">{{info.shouyi_day}}</div>
					<div class="dt">{{_i18n('今日收入')}}</div>
				</div>
				<div class="item">
					<div class="da">{{info.shouyi_yesterday}}</div>
					<div class="dt">{{_i18n('昨日收入')}}</div>
				</div>
				<div class="item">
					<div class="da">{{info.shouyi_week}}</div>
					<div class="dt">{{_i18n('本周收入')}}</div>
				</div>
				<div class="item">
					<div class="da">{{info.shouyi_month}}</div>
					<div class="dt">{{_i18n('本月收入')}}</div>
				</div>
				<div class="item">
					<div class="da">{{info.shouyi_total}}</div>
					<div class="dt">{{_i18n('累计收入')}}</div>
				</div>
			</div>
		</div>
		<div class="box zhubo">
			<div class="title">{{_i18n('主播数据')}}</div>
			<div class="list">
				<div class="item">
					<div class="da">{{info.reg_yesterday}}</div>
					<div class="dt">{{_i18n('昨日新增主播')}}</div>
				</div>
				<div class="item">
					<div class="da">{{info.reg_total}}</div>
					<div class="dt">{{_i18n('累计主播')}}</div>
				</div>
				<div class="item">
					<div class="da">{{info.login_yesterday}}</div>
					<div class="dt">{{_i18n('昨日登录主播')}}</div>
				</div>
				<div class="item">
					<div class="da">{{info.online_yesterday}}</div>
					<div class="dt">{{_i18n('昨日主播在线时长')}}(h)</div>
				</div>
			</div>
		</div>
   </div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/ffkj.js"></script>
<script src="../../script/vue.js"></script>
<script>
    var view = new Vue({
        el: '#view',
		data: {
			info:{
				"shouyi_day": 0,
				"shouyi_yesterday": 0,
				"shouyi_week": 0,
				"shouyi_month": 0,
				"shouyi_total": 0,
				"reg_yesterday": 0,
				"reg_total": 0,
				"login_yesterday": 0,
				"online_day": 0,
				"online_yesterday": 0,
				"online_week": 0,
				"online_month": 0,
				"online_total": 0,
				"bond_money": "0.00",
				"expire_time": null,
				"name": "",
				"yqm": ""
			}
		},
		methods: {
			copyText() {
				copyTxt(this.info.yqm)
			}
		},
	})
    var moreType = 0;
    apiready = function() {
       getInfo()
    }
	
	function getInfo() {
	    _ajax('api/proxy/dashboard', function(ret, err) {
	        if (ret && ret.data && ret.data) {
					  view.info = ret.data
	        } 
	    }, {
			user_id: $api.getStorage('userid')
		})
	}
</script>

</html>